<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>D3交互式数据可视化</title>
</head>
<body>
	<ul>
		<li class="test">选择集</li>
		<li>选择集的状态：empty   node  size</li>
		<li>设定或获取选择集属性的函数：
			<ul>
				<li>target.attr("class","test1 test2 test3");</li>
				<li>target.classed("test1 test2",false)</li>
				<li>target.style({"color":"red","font-size":"20px"})--v4版本不支持</li>
				<li>d3.select(".input").property("value","this is a input")</li>
				<li>d3.select(".test").text("this is a test")</li>
				<li>d3.select(".test").html("this is a test")</li>
			</ul>
		</li>
		<li class="opreat">添加、插入和删除</li>
	</ul>
	<input type="text" class="input">
	<script src="js/d3_3.5.7.js"></script>
	<script>
		var sele = d3.select("ul").selectAll("li")
		var empty = sele.empty();
		var node = sele.node(); //返回第一个非空子集
		var size = sele.size();
		//console.log(empty,node,size)
		var target = d3.select(".test");
		target.attr("class","test1 test2 test3");
		target.classed("test1 test2",false);
		target.style({"color":"red","font-size":"20px"}) //v4版本不支持
		d3.select(".input").property("value","this is a input");
		var ul = d3.select(".opreat").append("ul");
		ul.append("li").text("append()");
		ul.append("li").text("insert()");
		ul.append("li").text("remove()");
		//ul.remove();
		
		//console.log(node)
		
		var test = d3.set([1,2,3,4])
		test.add(7)
		
		console.log(test.values())
	</script>
</body>
</html>